/*
 * Copyright 2014 Semidata. All rights reserved.
 */
package com.semidata.rtd.core.tcp.client;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;

/**
 * @author shewei@semidata.com, She Wei
 *
 */
public class TcpClientIntializer extends ChannelInitializer<Channel> {

	private TcpResponseHandler handler;
	
	public TcpClientIntializer(TcpResponseHandler handler) {
		this.handler = handler;
	}
	
    @Override
    protected void initChannel(Channel ch) throws Exception {
    	ChannelPipeline pipeline = ch.pipeline();
		pipeline.addLast("handler", new TcpClientHandler(handler));
    }

	
}
